<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
%>
<!--  修改子课程 2010-07-02 -->
<html>
  <head>
    <title>修改子课程</title>
	<link href="<%=path %>/css/index_css.css" rel="stylesheet" type="text/css" />
	<script language="javascript" src="<%=path %>/js/syAjax.js"></script>
	<script language="javascript" src="<%=path %>/js/validate.js"></script>
	<script type="text/javascript">
	      
	     function checkForm()
	     {
	       var name=document.getElementById("name");
	       if(name.value=="")
	       {
	         alert("学科名称不能为空！");
	         name.focus();
	         return false;
	       }
	       if(document.getElementById('sort').value!="")
	       {
	       if(!isNumber(document.getElementById('sort'))){
				alert('序号只能为数字，请重新输入！');
				return;
			}
			}
			 var description=document.getElementById("description");
			  if(description.value.len()>100){
			  	description.focus();
			  	alert("描述内容太多，请控制在50个汉字以内！");
			  	return;
			  }
	       syAjax.request("post","updateCourseAction.action","course.name="+document.getElementById("name").value+"&course.sort="+document.getElementById("sort").value+"&course.courseId="+document.getElementById("courseId").value+"&course.description="+document.getElementById("description").value+"&course.status=1"+"&course.parent="+document.getElementById("parent").value,{success:initSuccessResult,fail:onFail,type:'plain'});
	     }
	
		function initSuccessResult(data){
			window.returnValue=data;
			window.close();
		}
	</script>
  </head>
  <body bgcolor="#ECE9D8">
  <form action="" method="post" name="courseForm">
    <table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="25" align="left" valign="bottom" bgcolor="#ECE9D8" class="f_8">&nbsp;&nbsp;&nbsp;&nbsp;注：<span class="f_11">*</span>为必填项</td>
  </tr>
  <tr>
    <td height="12" align="center" valign="middle" bgcolor="#ECE9D8">
    <table width="95%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="1" bgcolor="#ABA899"></td>
      </tr>
      <tr>
        <td height="1" bgcolor="#FFFFFF"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="25" align="center" valign="top" bgcolor="#ECE9D8">
    <table width="93%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="30%" height="30" align="right" class="f_6" nowrap="nowrap">学科编号：</td>
        <td width="70%" align="left">${courseById.courseId }</td>
      </tr>
      <tr>
        <td width="30%" height="30" align="right" class="f_6"><span class="f_11">* </span>学科名称：</td>
        <td width="70%" align="left"><input type="text" name="course.name" id="name" value="${courseById.name }" maxlength="25"/></td>
      </tr>
      <tr>
        <td height="30" align="right" class="f_6">序号：</td>
        <td align="left">
        <input type="text" name="course.sort" id="sort" value="${courseById.sort }"/>
        <input type="hidden" name="course.courseId" id="courseId" value="${courseById.courseId }" />
        <input type="hidden" name="course.parent" id="parent" value="${courseById.parent }" />
        </td>
      </tr>
      <tr>
        <td height="5" colspan="2" align="right" valign="top" class="f_6">&nbsp;</td>
      </tr>
      <tr>
        <td height="30" align="right" valign="top" class="f_6">描述：</td>
        <td align="left" valign="top"><textarea name="course.description" cols="50" rows="5" id="description">${courseById.description }</textarea></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="25" align="center" valign="middle" bgcolor="#ECE9D8">
     <table width="95%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="1" bgcolor="#ECE9D8"><br></td>
      </tr>
      <tr>
        <td height="1" bgcolor="#ECE9D8"><br></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="25" align="center" valign="middle" bgcolor="#ECE9D8"><input type="button" onclick="checkForm();" name="Submit" value="提 交" /></td>
  </tr>
</table>
</form>
  </body>
</html>
